package interfejsPracownik;

import interfejsKlient.MainPane;
import interfejsKlient.ManagerPaneli;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.geometry.Pos;
import javafx.scene.control.Button;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.layout.HBox;

public class PanelAdmin extends MainPane{

	
	Image dodajUsera = new Image("file:grafa/dodajUsera.png");
	Image usunUsera = new Image("file:grafa/usunUsera.png");
	private Button dodajPracownika = new Button();
	private Button usunPracownika = new Button();
    
	public PanelAdmin(){
		HBox buttony = new HBox(40);
		buttony.setAlignment(Pos.CENTER);
		dodajPracownika.setPrefSize(100, 80);
		usunPracownika.setPrefSize(100, 80);
		
		
		dodajPracownika.setGraphic(new ImageView(dodajUsera));
		usunPracownika.setGraphic(new ImageView(usunUsera));
		buttony.getChildren().addAll(dodajPracownika, usunPracownika);
        pane.setCenter(buttony);
        
        
        /***********************************************/
        dodajPracownika.setOnAction(new EventHandler<ActionEvent>() {

			@Override
			public void handle(ActionEvent arg0) {
				ManagerPaneli.next(new PanelDodajPracownika());
				
			}
        	
		});
        
        usunPracownika.setOnAction(new EventHandler<ActionEvent>() {

			@Override
			public void handle(ActionEvent arg0) {
				ManagerPaneli.next(new PanelUsunPracownika());
				
			}
        	
		});
        
        /***********************************************/
	}//koniec konstruktora
	
	
	
}//koniec klasy
